import React from "react";
// 引入相关的hooks
import { useSelector } from "react-redux";
import { getBalance } from "@/store/balanceSlice/getBalance";
function Counter() {
  // 方法抽离到外部
  const store = useSelector((store) => store);
  const balance = getBalance(store);
  return (
    <div className="counter">
      <div className="header">
        <h1>counter</h1>
      </div>
      <div>平衡项：{balance}</div>
    </div>
  );
}

export default Counter;
